libxl: Fix assignment of devid value returned from libxl__device_nextid
authorJim Fehlig <jfehlig@suse.com>
Tue, 25 Jun 2013 22:02:15 +0000 (16:02 -0600)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 26 Jun 2013 16:22:37 +0000 (17:22 +0100)
commitdfeccbeaa6536ceb3303380361b7ac18e1013292
tree356c21da8e1fe221534eae63195ecd95c92c31ff
parent59912eb06fda88af6c5ec16a2a382619d3829a7b
libxl: Fix assignment of devid value returned from libxl__device_nextid

Commit 5420f265 has some misplaced parenthesis that caused devid
to be assigned 1 or 0 based on checking return value of
libxl__device_nextid < 0, e.g.

  devid = libxl__device_nextid(...) < 0

This works when only one instance of a given device type exists, but
subsequent devices of the same type will also have a devid = 1 if
libxl__device_nextid succeeds.  Fix by checking the value assigned to
devid, e.g.

  (devid = libxl__device_nextid(...)) < 0

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c